export default function (timestamp, showTime = false) {
  const date = new Date(+timestamp)
  if (!showTime) {
    return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`
  } else {
    return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} 
      ${date.getHours().toString().padStart(2, '0')}:
      ${date.getMinutes().toString().padStart(2, '0')}:
      ${date.getSeconds().toString().padStart(2, '0')}`
  }
}
